<template>

  <el-config-provider :locale="locale">
    <router-view />
  </el-config-provider>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import { ElConfigProvider } from 'element-plus'

import zhCn from 'element-plus/lib/locale/lang/zh-cn'

export default defineComponent({
  components: {
    ElConfigProvider,
  },
  setup() {
    return {
      locale: zhCn,
    }
  },
  mounted() {
    document.body.style.setProperty('--el-color-primary', '#00A0E9');
    this.setRootFontSize();
  },
  methods:{
    setRootFontSize() {
      //默认宽度
      let w = 375;
      //默认基准
      let fontSize:number = 10;
      let width:number = document.documentElement.clientWidth;
      if (width > 750) {
        width = 750;
      }
      if (width > w) {
        fontSize += (width / w);
      }
   (   document.getElementsByTagName('html')[0] as any).style['font-size'] = fontSize + 'px';
    }
  }
})
</script>

<style lang="scss">
// @font-face {
//   font-family: PingFangSC-Medium;

//   src: url('./styles/PingFang\ Medium.ttf');
//   /* IE9+,可以是具体的实际链接 */

// }
// @font-face {
//   font-family: PingFangSC-Regular;

//   src: url('./styles/PingFang\ SC\ Regular.ttf');
//   /* IE9+,可以是具体的实际链接 */

// }


html,
body,
#app,
.layout-module {
  height: 100%;
}

#app {
  // font-family: PingFangSC-Medium, PingFang SC, Avenir, Helvetica, Arial, sans-serif;

  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 14px;
  color: $text-color;
  // font-weight: $font-weight;
}

body {
  margin: 0px;
}


.white-module {
  border-radius: 12px;
  background-color: #fff;
  padding-bottom: 24px;
}

//给表单组件加背景
.el-input {
  .el-input__wrapper {

    background: #F5F7FA !important;
  }
}

.scholl-tabs {
  position: relative;
  display: flex;
  padding-bottom: 16px;
  padding-left: 24px;
  border-bottom: 1px solid #EEEEEE;

  .item {
    color: #4F5A70;
    margin-right: 54px;
  }

  .active {
    font-weight: $font-weight-bold;
    color: $color-primary;
    position: relative;

    &::after {
      position: absolute;
      left: 25%;
      width: 50%;
      bottom: -16px;
      content: "";
      height: 2px;
      background: #00A0E9;
    }
  }

  .tabs-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 14px;
    z-index: 3;
  }
}

.global-table {
  .el-table {
    th.el-table__cell {
      background: #f5f7fa !important;
      color: #333 !important;
    }

    .cell {
      line-height: 36px !important;
      color: #4F5A70;
      font-size: 14px;
    }

    .el-button--small {
      font-size: 14px;
    }

    .table-text-btn {
      color: $color-primary;
      margin-right: 12px;
      cursor: pointer;
    }
  }

  .el-scrollbar {
    --el-scrollbar-opacity: 1;
    --el-scrollbar-bg-color: #a4abb9;
    border-radius: 4px;
  }

  .el-scrollbar__bar.is-vertical {
    width: 8px;
    background: none;
    /*可以设置轨道颜色*/
  }

  .el-scrollbar::-webkit-scrollbar-thumb {
    background-color: red !important;
    border-radius: 3px !important;
  }
}


.search-module {
  .search-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    .item {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      margin-right: 32px;

      span.text {
        width: 56px;
        text-align: right;
      }
    }
  }

  .right-btn {
    display: flex;
    justify-content: flex-end;
  }

  >.el-input,
  .el-select {
    width: 220px;

    margin-left: 8px;

    .el-input__wrapper {
      width: 100%;
    }

    .el-input__inner {
      width: 100%;
      height: 30px;
      line-height: 30px;
    }

  }

  .el-date-editor.el-input {
    width: 130px !important;
    margin-left: 8px;

    .el-input__prefix {
      display: none !important;
    }
  }

  .interval {
    padding: 0px 16px;

  }
}

.global-ruleForm {
  .el-form-item__label {
    color: $text-color;
  }

  .el-input,
  .el-select {

    .el-input {
      width: 100%;
    }


    .el-input__inner {
      height: 38px;
      width: 100%;
      line-height: 38px;
    }
  }

  .min-select {
    width: 248px;

    .el-input {
      width: 100%;
    }
  }

  .btns {
    margin-bottom: 0px;

    .el-form-item__content {
      justify-content: center;
      margin-top: 12px;

      .el-button {
        width: 88px;
        margin: 0px 9px;
        height: 38px;
      }
    }
  }
}

.global-pagination {
  display: flex;
  align-items: center;
  margin-top: 22px;
  padding: 0px 24px;

  .total {
    color: #959ca9;
    font-size: 14px;
    text-align: left;
  }

  .el-pagination {
    display: flex;
    justify-content: flex-end;
  }
}

.global-scroll {
  margin-right: 8px;

  /*设置宽度,轨道颜色*/
  &::-webkit-scrollbar {
    width: 8px;
    background: none;
    /*可以设置轨道颜色*/
  }

  /*滚动条*/
  &::-webkit-scrollbar-thumb {
    background: #a4abb9;
    border-radius: 4px;
    height: 8px;
  }
}

.global-hint-dialog {
  border-radius: 10px !important;

}

.confirm-dialog {
  margin-top: -20px;
  margin-bottom: -5px;

  .image {
    img {
      width: 40px;
      height: 40px;
      display: block;
      margin: auto;
    }
  }

  .text {
    text-align: center;
    margin-top: 14px;
    color: #333;

  }

  .text-draw {
    font-size: 16px;
    color: #333;

    strong {
      color: $color-primary;
      font-size: 20px;
      padding: 0px 5px;
      font-weight: normal;
    }
  }

  .btns {
    display: flex;
    justify-content: center;
    margin-top: 45px;

    .el-button {
      width: 80px;
    }

    .el-button:first-child {
      margin-right: 10px;
    }
  }
}
</style>
